// 人物
import { CHARACTER } from './api';
import { request, METHOD } from '@/utils/request';

//添加
export async function addCharacterApi(params) {
  return request(CHARACTER + '/create', METHOD.POST, params);
}
//删除
export async function delCharacterApi(params) {
  return request(CHARACTER + '/delete/', METHOD.DELETE, params.id);
}
//修改
export async function editCharacterApi(params) {
  return request(CHARACTER + '/update/', METHOD.PUT, params);
}
//获取所有
export async function getCharacterListApi(params) {
  return request(CHARACTER + '/getAll', METHOD.GET, params);
}
//根据id查找
export async function getCharacterByIdApi(params) {
  return request(CHARACTER + '/getById', METHOD.GET, params);
}
export default {
  addCharacterApi,
  editCharacterApi,
  delCharacterApi,
  getCharacterListApi,
  getCharacterByIdApi,
};
